Image encryption method based on multi-scale compressed sensing and markov model

ABSTRACT

The present disclosure discloses an image encryption method based on multi-scale compressed sensing and a Markov model. According to the difference in information carried by low-frequency coefficients and high-frequency coefficients of an image, different sampling rates are set for the low-frequency coefficients and the high-frequency coefficients of the image, which can effectively improve the reconstruction quality of a decrypted image. The decrypted image obtained by the present disclosure has higher quality than the decrypted image generated by the existing scheme, and a better visual effect and more complete original image information can be obtained.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the priority of Chinese Patent Application Serial No. 202111111707.6, filed with the State Intellectual Property Office of P. R. China on Sep. 18, 2021, named “Image Encryption Method Based on Multi-scale Compressed Sensing and Markov Model”, the entire contents of which are incorporated herein by reference.

TECHNICAL FIELD

The present disclosure relates to the technical field of image encryption, in particular to an image encryption method based on multi-scale compressed sensing and a Markov model.

BACKGROUND

With the continuous development of social productivity and Internet technologies, digital image information, as an important carrier of Internet information, plays a very important role in the interaction of Internet information. In many fields involving personal privacy, commercial secrets, national defense secrets, national security and so on, the security requirements of digital image information are getting higher and higher, so digital image encryption technologies are becoming more and more important. At present, the commonly used digital image encryption technologies are relatively mature, but most of theoretical cores thereof are still mainly put forward by foreign countries. Throughout existing image encryption schemes, there are some weaknesses, such as easy access to the relevant information of original images, poor plaintext sensitivity and key sensitivity, poor reconstruction quality of decrypted images and poor encryption effects. Therefore, it is very urgent and necessary to comprehensively improve and innovatively provide a more perfect and safer digital image encryption method.

SUMMARY

In view of the above-mentioned shortcomings of prior art, the present disclosure provides an image encryption method based on multi-scale compressed sensing and a Markov model, which expands the application range of compressed sensing theory in the field of image encryption; a new pixel scrambling method is designed with the help of the Markov model; and finally encrypted images with better encryption effects and decrypted images with better decryption effects are obtained.

In order to achieve the above objective, the present disclosure adopts the following technical solution:

The image encryption method based on multi-scale compressed sensing and the Markov model includes:

generating parameters and initial values of one-dimensional chaotic mapping according to plaintext image information;

obtaining subsampling rates of original coefficient matrices at all levels by using multi-scale block compressed sensing theory through a total target sampling rate of a plaintext image;

substituting the parameters and initial values of the one-dimensional chaotic mapping into a corresponding chaotic system to generate chaotic sequences, transforming the chaotic sequences into a matrix form, and obtaining corresponding orthogonal basis matrices, and extracting some elements of the orthogonal basis matrices as measurement matrices according to the subsampling rates;

performing three-level discrete wavelet transform on the plaintext image to obtain the original coefficient matrices at all levels, and blocking the original coefficient matrices at all levels to construct new coefficient matrixes at all levels;

using the chaotic sequences to generate index sequences, and scrambling the corresponding coefficient matrices at all levels as blocks;

using the measurement matrices to measure the coefficient matrices at all levels;

retaining low-frequency coefficient matrices, merging measured non-low frequency coefficient matrices at all levels to construct a matrix T, performing micro-processing on the matrix T to obtain a to-be-measured matrix NT, and respectively generating a row-state transition probability matrix and a column-state transition probability matrix according to the to-be-measured matrix NT;

performing SVD decomposition on the low-frequency coefficient matrices to obtain submatrices, and quantizing the elements in the submatrices and the non-low frequency coefficient matrices at all levels to a preset interval;

generating index values according to the information of the chaotic sequences and determining merging rules by the index values, firstly mering the non-low frequency coefficient matrices at all levels according to the merging rules to obtain an overall matrix, and then inserting the submatrices into different positions of the overall matrix;

adjusting the dimension of the overall matrix, acquiring the element information of the overall matrix, and generating control parameters for secondary scrambling;

scrambling the merged overall matrix according to the row-state transition probability matrix and the column-state transition probability matrix, and simultaneously setting corresponding flag bits; and

performing independent diffusion of elements on the the overall matrix by using one of the chaotic sequences, and performing global diffusion on elements of the overall matrix by using the other chaotic sequences to obtain a final encrypted image.

Further, a specific method of generating parameters and initial values of one-dimensional chaotic mapping according to plaintext image information is as follows:

a SHA256 function is used for generating a hash value K of the plaintext image, and after K is transformed into a binary number, 32 sets of binary numbers k₁, k₂ . . . , k₃₂ are generated in groups of 8 bit;

$r_{0} = \left\{ \begin{matrix} {{r_{end} - \frac{{mod}\left( {{\left( {\frac{l_{0}}{L_{0}} + \frac{l_{1}}{L_{1}}} \right) \times r_{end} \times 10},1} \right)}{10}},{{\left( {\frac{l_{0}}{L_{0}} + \frac{l_{1}}{L_{1}}} \right) \times r_{end} \times 10} > r_{end}}} \\ {{\left( {\frac{l_{0}}{L_{0}} + \frac{l_{1}}{L_{1}}} \right) \times r_{end} \times 10},{{\left( {\frac{l_{0}}{L_{0}} + \frac{l_{1}}{L_{1}}} \right) \times r_{end} \times 10} \leq r_{end}}} \end{matrix} \right.$

where, L₀ and L₁ are the numbers of 0 and 1 in a hash value K of the plaintext image respectively, l₀ and l₁ are a length of a longest continuous 0 sequence and a length of a longest continuous 1 sequence respectively, r_(end) is a right endpoint of a chaotic interval, and r₀ is a certain value of the chaotic interval;

$\left\{ \begin{matrix} {r_{1} = {r_{start} + {{mod}\left( {{\left( \frac{\left( {{\max\left( {k_{1},k_{2},k_{3},k_{4},k_{5},k_{6}} \right)} \times t_{1}} \right)}{\left( {{\min\left( {k_{1},k_{2},k_{3},k_{4},k_{5},k_{6}} \right)} \times t_{2}} \right)} \right) \times 10^{14}},{r_{end} - r_{start}}} \right)}}} \\ {r_{2} = {r_{start} + {{mod}\left( {{\left( \frac{\left( {{\max\left( {k_{7},k_{8},k_{9},k_{10},k_{11},k_{12}} \right)} \times t_{3}} \right)}{\left( {{\min\left( {k_{7},k_{8},k_{9},k_{10},k_{11},k_{12}} \right)} \times t_{4}} \right)} \right) \times 10^{14}},{r_{end} - r_{start}}} \right)}}} \end{matrix} \right.$

where, k_(i), i=1, 2, . . . , 12 is the i-th binary number of K, t₁-t₄ is an external key, r_(start) is a left endpoint of the chaotic interval, r_(end) is the right endpoint of the chaotic interval, r₁ and r₂ are some values of the chaotic interval;

$\left\{ \begin{matrix} {a = \frac{r_{end}}{\left( {1 + e^{\frac{1}{256} \times {({{- t_{5}} \times {({k_{13} \oplus k_{14} \oplus k_{15}})}})}}} \right)}} \\ {b = \frac{r_{end}}{\left( {1 + e^{\frac{1}{256} \times {({{- t_{6}} \times {({k_{16} \oplus k_{17} \oplus k_{18}})}})}}} \right)}} \\ {c = {\frac{1}{2} \times \left( {\frac{r_{start}}{\left( {1 + e^{\frac{1}{256} \times {({{- t_{7}} \times {({k_{19} \oplus k_{20} \oplus k_{21}})}})}}} \right)} + \frac{r_{end}}{\left( {1 + e^{\frac{1}{256} \times {({{- t_{8}} \times {({k_{22} \oplus k_{23} \oplus k_{24}})}})}}} \right)}} \right)}} \end{matrix} \right.$

where, k_(i), i=13, 14, . . . , 24 is the i-th binary number of K, t₅-t₈ is an external key, r_(start) is the left endpoint of the chaotic interval, r_(end) is the right endpoint of the chaotic interval, and a, b and c are some values of the chaotic interval;

$\left\{ \begin{matrix} {Z_{1} = \begin{bmatrix} {t_{1} \times k_{25}} & {t_{3} \times k_{26}} \\ {t_{5} \times k_{27}} & {t_{7} \times k_{28}} \end{bmatrix}} \\ {Z_{2} = \begin{bmatrix} {t_{5} \times k_{29}} & {t_{4} \times k_{30}} \\ {t_{6} \times k_{31}} & {t_{8} \times k_{32}} \end{bmatrix}} \end{matrix} \right.$

where, k_(i), i=25, 14, . . . , 32 is the i-th binary number of K, t₁-t₈ is an external key, and Z₁ and Z₂ are transition matrices;

$\left\{ \begin{matrix} {x_{0} = {{mod}\left( {{\left( {{Z_{3}(1)} + {Z_{3}(2)} - \left\lfloor {{Z_{3}(1)} + {Z_{3}(2)}} \right\rfloor} \right) \times 10^{14}},1} \right)}} \\ {x_{00} = {{mod}\left( {{\left( {{Z_{3}(3)} + {Z_{3}(4)} - \left\lfloor {{Z_{3}(3)} + {Z_{3}(4)}} \right\rfloor} \right) \times 10^{14}},1} \right)}} \\ {y_{00} = {{mod}\left( {{\left( {{Z_{3}(1)} + {Z_{3}(3)} - \left\lfloor {{Z_{3}(1)} + {Z_{3}(3)}} \right\rfloor} \right) \times 10^{14}},1} \right)}} \\ {v_{0} = {{mod}\left( {{\left( {{Z_{3}(2)} + {Z_{3}(4)} - \left\lfloor {{Z_{3}(2)} + {Z_{3}(4)}} \right\rfloor} \right) \times 10^{14}},1} \right)}} \end{matrix} \right.$

where, └⋅┘ presents downward rounding, Z₃ is a Kronecker product of transition Z₁ and transition Z₂, Z₃ (i), 1=1, 2, 3, 4 represents the i-th element of the matrix Z₃, and x₀, x₀₀, y₀₀, v₀ are the initial values of the corresponding chaotic mapping, respectively.

Further, a specific method of scrambling the corresponding coefficient matrices at all levels as the blocks comprises:

letting a matrix A₃ be an m×n matrix, expanding the matrix A₃ into a sequence with a length being m×n, wherein i is the index of the i-th element in the sequence, a scrambling method of which is as follows:

A ₃′(Ind ₃(m×n−i+1))=A ₃(Ind ₃(i))

where, A₃′ is a sequence after A₃ is scrambled, and Ind₃ is an index sequence for scrambling third-level wavelet decomposition coefficient matrices; and similarly, other coefficient matrices H_(i)′, V_(i)′, D_(i)′, i=1, 2, 3 after scrambling are obtained.

Further, a specific method of performing micro-processing on the matrix T to obtain the to-be-measured matrix NT is as follows:

$T = \begin{pmatrix} H_{1}^{''} & V_{1}^{''} & D_{1}^{''} \\ H_{2}^{''} & V_{2}^{''} & D_{2}^{''} \\ H_{3}^{''} & V_{3}^{''} & D_{3}^{''} \end{pmatrix}$

where, H_(i)″, V_(i)″, D_(i)″, i=1, 2, 3 are coefficient matrices after H_(i)′, V_(i)′, D_(i)′, i=1, 2, 3 are compressed, and T is a coefficient merging matrix;

$\left\{ \begin{matrix} {{{NT}\  = {- T}},{l_{0} > l_{1}}} \\ {{{NT}\  = {T - {0\text{.5}}}},{L_{0} > L_{1}}} \\ {{{NT}\  = {T + {0\text{.5}}}},{L_{0} < L_{1}}} \end{matrix} \right.$

where, L₀ and L₁ are the numbers of 0 and 1 in the hash value K of the plaintext image respectively, l₀ and l₁ are the length of the longest continuous 0 sequence and the length of the longest continuous 1 sequence respectively, and NT is the to-be-measured matrix after processing T.

Further, a specific method of firstly mering the non-low frequency coefficient matrices at all levels according to the merging rules to obtain the overall matrix is as follows:

$\left\{ \begin{matrix} {{Lind_{1}} = {\left( {{X_{1}^{\prime}\left( {n_{1} \times n_{1}} \right)} + {X_{2}^{\prime}\left( {n_{2} \times n_{2}} \right)} + {X_{3}^{\prime}\left( {n_{3} \times n_{3}} \right)}} \right)/3}} \\ {{Lind_{1}} = {{{floor}\left( {{mod}\left( {{{{abs}\left( {{Lin}d_{1}} \right)} \times 10^{8}},6} \right)} \right)} + 1}} \\ {{Lind}_{2}\  = {\left( {{X_{1}^{\prime}\left( {{n_{1} \times n_{1}} - 1} \right)} + {X_{2}^{\prime}\left( {{n_{2} \times n_{2}} - 1} \right)} + {X_{3}^{\prime}\left( {{n_{3} \times n_{3}} - 1} \right)}} \right)/3}} \\ {{Lind_{2}} = {{{floor}\left( {{mod}\left( {{{{abs}\left( {{Lin}d_{2}} \right)} \times 10^{8}},6} \right)} \right)} + 1}} \\ {{Lind}_{3}\  = {\left( {{X_{1}^{\prime}\left( {{n_{1} \times n_{1}} - 1} \right)} + {X_{2}^{\prime}\left( {{n_{2} \times n_{2}} - 1} \right)} + {X_{3}^{\prime}\left( {{n_{3} \times n_{3}} - 1} \right)}} \right)/3}} \\ {{Lind_{3}} = {{{floor}\left( {{mod}\left( {{{{abs}\left( {{Lin}d_{3}} \right)} \times 10^{8}},6} \right)} \right)} + 1}} \end{matrix} \right.$

where, Lind_(i), i=1, 2, 3 is an index value generated by the chaotic sequence X_(i)′, i=1, 2, 3, n_(i)×n_(i), i=1, 2, 3 is a length of X_(i)′, i=1, 2, 3, and Lind_(i)′, i=1, 2, 3 is a result of mapping Lind_(i), i=1, 2, 3 to an interval [1, 6];

$\left\{ \begin{matrix} {{\begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix} = \begin{pmatrix} H_{3}^{\prime''} \\ H_{2}^{\prime''} \\ H_{1}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix} = \begin{pmatrix} V_{3}^{\prime''} \\ V_{2}^{\prime''} \\ V_{1}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix} = \begin{pmatrix} D_{3}^{\prime''} \\ D_{2}^{\prime''} \\ D_{1}^{\prime''} \end{pmatrix}}} \\ {{\begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix} = \begin{pmatrix} H_{3}^{\prime''} \\ H_{1}^{\prime''} \\ H_{2}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix} = \begin{pmatrix} V_{3}^{\prime''} \\ V_{1}^{\prime''} \\ V_{2}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix} = \begin{pmatrix} D_{3}^{\prime''} \\ D_{1}^{\prime''} \\ D_{2}^{\prime''} \end{pmatrix}}} \\ {{\begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix} = \begin{pmatrix} H_{2}^{\prime''} \\ H_{3}^{\prime''} \\ H_{1}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix} = \begin{pmatrix} V_{2}^{\prime''} \\ V_{3}^{\prime''} \\ V_{1}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix} = \begin{pmatrix} D_{2}^{\prime''} \\ D_{3}^{\prime''} \\ D_{1}^{\prime''} \end{pmatrix}}} \\ {{\begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix} = \begin{pmatrix} H_{2}^{\prime''} \\ H_{1}^{\prime''} \\ H_{3}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix} = \begin{pmatrix} V_{2}^{\prime''} \\ V_{1}^{\prime''} \\ V_{3}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix} = \begin{pmatrix} D_{2}^{\prime''} \\ D_{1}^{\prime''} \\ D_{3}^{\prime''} \end{pmatrix}}} \\ {{\begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix} = \begin{pmatrix} H_{1}^{\prime''} \\ H_{3}^{\prime''} \\ H_{2}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix} = \begin{pmatrix} V_{1}^{\prime''} \\ V_{3}^{\prime''} \\ V_{2}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix} = \begin{pmatrix} D_{1}^{\prime''} \\ D_{3}^{\prime''} \\ D_{2}^{\prime''} \end{pmatrix}}} \\ {{\begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix} = \begin{pmatrix} H_{1}^{\prime''} \\ H_{2}^{\prime''} \\ H_{3}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix} = \begin{pmatrix} V_{1}^{\prime''} \\ V_{2}^{\prime''} \\ V_{3}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix} = \begin{pmatrix} D_{1}^{\prime''} \\ D_{2}^{\prime''} \\ D_{3}^{\prime''} \end{pmatrix}}} \end{matrix} \right.$

where, H_(i)′″, V_(i)′″, D_(i)′″, i=1, 2, 3 is a result of quantizing H_(i)″, V_(i)″, D_(i)″, i=1, 2, 3 to [0, 255], a first group of sorted matrices are marked as Y₁, three internal block matrices are marked as Y₁₁, Y₁₂, Y₁₃ respectively, and a sorting order is determined by Lind₁′; a second group of sorted matrices are marked as Y₂, three internal block matrices are marked as Y₂₁, Y₂₂, Y₂₃, and a sorting order is determined by Lind₂′; and a third group of sorted matrices are marked as Y₃, three internal block matrices are marked as Y₃₁, Y₃₂, Y₃₃, and a sorting order is determined by Lind₃′ D.

Further, a specific method of inserting the submatrices into different positions of the overall matrix is as follows:

$\left\{ \begin{matrix} {{Hind_{1}} = {\left( {{X_{1}^{\prime}(1)} + {X_{2}^{\prime}(1)} + {X_{3}^{\prime}(1)}} \right)/3}} \\ {{Hind}_{2}\  = {\left( {{X_{1}^{\prime}(2)} + {X_{2}^{\prime}(2)} + {X_{3}^{\prime}(2)}} \right)/3}} \\ {{Hind}_{3}\  = {\left( {{X_{1}^{\prime}(3)} + {X_{2}^{\prime}(3)} + {X_{3}^{\prime}(3)}} \right)/3}} \\ {{Hind}_{1}^{\prime} = {{{floor}\left( {{mod}\left( {{{{abs}\left( {{Hin}d_{1}} \right)} \times 10^{8}},4} \right)} \right)} + 1}} \\ {{Hind}_{2}^{\prime} = {{{floor}\left( {{mod}\left( {{{{abs}\left( {{Hin}d_{2}} \right)} \times 10^{8}},4} \right)} \right)} + 1}} \\ {{Hind}_{3}^{\prime} = {{{floor}\left( {{mod}\left( {{{{abs}\left( {{Hin}d_{3}} \right)} \times 10^{8}},4} \right)} \right)} + 1}} \end{matrix} \right.$

where, Hind_(i), i=1, 2, 3 is an index value generated by the chaotic sequence X_(i)′, i=1, 2, 3, and Hind_(i)′, i=1, 2, 3 is a result of mapping Hind_(i), i=1, 2, 3 to the interval [1, 4];

$\left\{ \begin{matrix} {{Y_{1}^{\prime} = \begin{pmatrix} U \\ Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix}},{Y_{2}^{\prime} = \begin{pmatrix} S \\ Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix}},{Y_{3}^{\prime} = \begin{pmatrix} {VT} \\ Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix}}} \\ {{Y_{1}^{\prime} = \begin{pmatrix} Y_{11} \\ U \\ Y_{12} \\ Y_{13} \end{pmatrix}},{Y_{2}^{\prime} = \begin{pmatrix} Y_{21} \\ S \\ Y_{22} \\ Y_{23} \end{pmatrix}},{Y_{3}^{\prime} = \begin{pmatrix} Y_{31} \\ {VT} \\ Y_{32} \\ Y_{33} \end{pmatrix}}} \\ {{Y_{1}^{\prime} = \begin{pmatrix} Y_{11} \\ Y_{12} \\ U \\ Y_{13} \end{pmatrix}},{Y_{2}^{\prime} = \begin{pmatrix} Y_{21} \\ Y_{22} \\ S \\ Y_{23} \end{pmatrix}},{Y_{3}^{\prime} = \begin{pmatrix} Y_{31} \\ Y_{32} \\ {VT} \\ Y_{33} \end{pmatrix}}} \\ {{Y_{1}^{\prime} = \begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \\ U \end{pmatrix}},{Y_{2}^{\prime} = \begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \\ S \end{pmatrix}},{Y_{3}^{\prime} = \begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \\ {VT} \end{pmatrix}}} \end{matrix} \right.$ $T^{\prime} = \left( \begin{matrix} Y_{1}^{\prime} & Y_{2}^{\prime} & Y_{3}^{\prime} \end{matrix}\  \right)$

where, Y₁′ is a matrix after the first group merging, and the sorting order is determined by Hind₁′; Y₂′ is a matrix after the second group merging, and the sorting order is determined by Hind₂′; Y₃′ is a matrix after the third group merging, and the sorting order is determined by Hind₃′; T′ is a matrix after Y₁′, Y₂′ and Y₃′ are merged; and U, S and VT are three submatrices obtained by SVD decomposition of the low-frequency coefficient matrices at levels.

Further, a specific method of adjusting the dimension of the overall matrix and acquiring the element information of the overall matrix is as follows:

$\left\{ \begin{matrix} {{Max} = {\max\left( T^{\prime} \right)}} \\ {{Min} = {\min\left( T^{\prime} \right)}} \\ {d_{1} = {{floor}\left( {{mean}\left( T^{\prime} \right)} \right)}} \\ {d_{2} = {{ceil}\left( {\left( {{Max} + {Min}} \right)/2} \right)}} \\ {d_{1}^{\prime} = {{mod}\ \left( {d_{1},{10}} \right)}} \\ {d_{2}^{\prime} = {{mod}\ \left( {d_{2},{10}} \right)}} \\ {d_{12} = {\max\left( {d_{1}^{\prime},\ d_{2}^{\prime}} \right)}} \end{matrix} \right.$

where, Max is the maximum value of the matrix T′, Min is the minimum value of the T′, d₁ is the maximum integer less than or equal to the average value of elements in the T′, d₂ is the minimum integer greater than or equal to the average value of Max and Min, d₁′ is the remainder of d₁ divided by 10, d₂′ is the remainder of d₂ divided by 10, and d₁₂ is the larger of d1′ and d2′.

Further, a specific method of generating the control parameters for secondary scrambling is as follows:

$\left\{ \begin{matrix} {V_{1} = {{10 \times V^{\prime}} - {{round}\left( {10 \times V^{\prime}} \right)}}} \\ {V_{2} = {{10^{2} \times V^{\prime}} - {{round}\left( {10^{2} \times V^{\prime}} \right)}}} \\ {V_{3} = {{10^{3} \times V^{\prime}} - {{round}\left( {10^{3} \times V^{\prime}} \right)}}} \\ {V_{4} = {{10^{4} \times V^{\prime}} - {{round}\left( {10^{4} \times V^{\prime}} \right)}}} \end{matrix} \right.$

where, V′ is a generated and processed chaotic sequence, and V_(i), i=1, 2, 3, 4 is a subsequence generated by V′;

$\left\{ \begin{matrix} {w_{1} = {{fix}\left( {{mod}\ \left( {{V_{1}\left( {m_{1}^{\prime} + n_{1}^{\prime}} \right)} + {1,5}} \right)} \right)}} \\ {w_{2} = \ {{fix}\ \left( {{mod}\ \left( {{V_{2}\ \left( {{{round}\ \left( {{m_{1}^{\prime}/_{2}{+ n_{1}^{\prime}}}/_{2}} \right)} + 2} \right)} \times 10^{2},5^{2}} \right)} \right)}} \\ {w_{3} = \ {{fix}\ \left( {{mod}\left( {{V_{3}\left( {{abs}\ \left( {{round}\ \left( {\left( {{m_{1}^{\prime}/_{3}{- n_{1}^{\prime}}}/_{3}} \right) + 3} \right)} \right)} \right)} \times 10^{3},5^{3}} \right)} \right)}} \\ {w_{4} = \ {{fix}\ \left( {{mod}\ \left( {{V_{4}\left( {{abs}\ \left( {{{round}\ \left( {{m_{1}^{\prime}/_{4}{- n_{1}^{\prime}}}/_{4}} \right)} + 4} \right)} \right)} \times 10^{4},5^{4}} \right)} \right)}} \end{matrix} \right.$

where, w₁-w₄ are used as control parameters for subsequent shift operation, and fix is a rounding function to zero; and m₁′ is a maximum prime factor of a matrix row dimension m₁, and n₁′ is a maximum prime factor of a matrix column dimension n₁.

The encrypted image obtained by the present disclosure has higher information entropy than the encrypted image generated by the existing scheme, it is difficult to obtain the relevant information of an original image, and at the same time, the encrypted image obtained by the present disclosure has better plaintext sensitivity and key sensitivity, and can resist various attacks. The decrypted image obtained by the present disclosure has higher quality than the decrypted image generated by the existing scheme, and a better visual effect and more complete original image information can be obtained.

Compared with the existing methods, the present disclosure has the following advantages:

1. The concept of a transition probability matrix in the Markov model is introduced to scramble the image, the state space is defined according to the characteristics of image pixel values in the encryption process, and a state transition probability matrix is constructed according to the distribution of pixel values, so that the encryption process has relatively good randomness, which is difficult to predict.

2. The information of plaintext images and chaotic sequences is used in the whole encryption process, which makes the encryption scheme have better plaintext sensitivity and can effectively resist and select plaintext attacks and known plaintext attacks.

3. The multi-scale block compressed sensing theory is introduced to set the sampling rate of the image more reasonably, which greatly improves the reconstruction quality of the decrypted image.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a frame diagram of an encryption process of the present disclosure; and

FIG. 2 is a schematic diagram of three-level wavelet decomposition of the present disclosure.

DETAILED DESCRIPTION OF THE EMBODIMENTS

Firstly, an image is subjected to wavelet decomposition to obtain original coefficient matrices at all levels, secondly, the coefficient matrices at all levels are scrambled once, then the corresponding coefficient matrices are measured by multiple measurement matrices respectively, afterwards, the merged measurement matrices are scrambled twice by means of a state transition probability matrix, and finally the final encrypted image is obtained by diffusion. The decryption process is the reverse process of the encryption process.

There are four chaotic mapping used in the present disclosure, which are respectively TSL mapping, TLT mapping, Hybrid mapping and ISEL mapping.

The TSL mapping, TLT mapping, and Hybrid mapping are used for constructing measurement matrices, index sequences for first scrambling, and index values of coefficient matrix merging rules. The ISEL mapping is used for generating control parameters for second scrambling, and diffusion sequences for independent diffusion and global diffusion.

A construction method of the state transition probability matrix used in the present disclosure comprises:

firstly, constructing state space, and dividing numbers into four categories, which are defined as follows:

(1) if the integer part of a number is both positive and odd, the number is a positive odd number.

(2) if the integer part of a number is both negative and odd, the number is a negative odd number.

(3) if the integer part of a number is both positive and even, the number is a positive even number.

(4) if the integer part of a number is both negative and even, the number is a negative even number.

Then, initializing a 4×4 matrix f which is used for recording the frequency number of state transition. For each column of vectors of a to-be-measured matrix, firstly determining which category of number a first element belongs to, that is, determining row coordinates of the state transition matrix. Then determining which category of number the next element belongs to, that is, determining column coordinates of the state transition matrix. The numerical value of the position in the matrix f corresponding to a coordinate point is plus 1. By analogy, the updated matrix f is obtained, which is as shown in Table 1, the sum of each row of the above matrix f is calculated, and each element in a row is divided by the sum of the corresponding row to obtain a corresponding probability. After all probabilities are calculated, a final row-state transition probability matrix is obtained, which is as shown in Table 2. A generation method of a column-state transition probability matrix is similar to that of the row-state transition probability matrix, except that row vectors are taken each time instead of column vectors of the to-be-measured matrix.

TABLE 1 Positive odd Negative odd Positive even Negative even number number number number Positive odd 3696 3796 4249 3289 number Negative odd 3833 3928 4409 3449 number Positive even 4217 4471 4937 3733 number Negative even 3284 3424 3763 2962 number

TABLE 2 Positive odd Negative odd Positive even Negative even number number number number Positive odd 0.2459 0.2526 0.2827 0.2188 number Negative odd 0.2454 0.2515 0.2823 0.2208 number Positive even 0.2429 0.2576 0.2844 0.2151 number Negative even 0.2445 0.2549 0.2801 0.2205 number

A method of scrambling pixels based on the state transition probability matrix used in the present disclosure is as follows:

for the row-state transition probability matrix (the column-state transition probability matrix), finding the position of a value with a probability value greater than 0.25 in the matrix. Row coordinates indicate the selection of odd/even column (row) vectors and the moving direction up/down (left/right). If the row coordinates are odd numbers, the odd column (row) is selected, and if the row coordinates are even numbers, the even column (row) is selected; and if the row coordinates are positive numbers, the selected element are moved up (left), and if the row coordinates are negative numbers, the selected element are moved down (right). Specifically, if the row of the selected number corresponds to a positive odd number, all odd columns (rows) of the matrix are moved up (left); if the row of the selected number corresponds to a negative odd number, all odd columns (rows) of the matrix are moved down (right); if the row of the selected number corresponds to a positive even number, all even number columns (rows) of the matrix are moved up (left); and if the row of the selected number corresponds to a negative even number, all even number columns (rows) of the matrix are moved down (right). The column coordinates indicate the shift number of cyclic shifts, and specific values are generated by chaotic mapping.

Embodiment 1

As shown in FIG. 1 , the embodiments of the present disclosure are implemented based on the technical solution of the present disclosure. Detailed implementation and specific operating processes are given, but the scope of protection of the present disclosure is not limited to the following embodiments. An external key set in the embodiment can be:

t₁=0.11, t₂=0.22, t₃=0.33, t₄=0.44, t₅=2.723, t₆=0.618, t₇=3.141, t₈=4.6692, t=600, the array block_size that determines the block size of the matrix is set to [32, 16, 8], that is, block_size₁=32, block_size₂=16, block_size₃=8, and the sampling rate is set to 0.25. The chaotic mapping is as described above.

Step 1. generating parameters and initial values of one-dimensional chaotic mapping according to plaintext image information.

For example, a SHA256 function is used for generating a hash value K of the plaintext image, and after K is transformed into a binary number, 32 sets of binary numbers k₁, k₂ . . . , k₃₂ are generated in groups of 8 bits. The number L₀ of 0 and the number L₁ of 1 in the hash value K of the plaintext, the length l₀ of the longest continuous 0 sequence and the length l₁ of the longest continuous 1 sequence are calculated. The parameters and initial values of one-dimensional chaotic mapping are generated according to the following formula.

$r_{0} = \left\{ {\begin{matrix} {{4 - \frac{{mod}\ \left( {\left( {\frac{l_{0}}{L_{0}} + \frac{l_{1}}{L_{1}}} \right) \times 40,1} \right)}{10}},{{\left( {\frac{l_{0}}{L_{0}} + \frac{l_{1}}{L_{1}}} \right) \times 40} > 4}} \\ {{\left( {\frac{l_{0}}{L_{0}} + \frac{l_{1}}{L_{1}}} \right) \times 40},{{\left( {\frac{l_{0}}{L_{0}} + \frac{l_{1}}{L_{1}}} \right) \times 40} \leq 4}} \end{matrix}\left\{ \begin{matrix} {r_{1} = {1.05 + {{mod}\ \left( {\left( \frac{\left( {{\max\left( {k_{1},k_{2},k_{3},k_{4},k_{5},k_{6}} \right)} \times t_{1}} \right)}{\left( {{\min\left( {k_{1},k_{2},k_{3},k_{4},k_{5},k_{6}} \right)} \times t_{2}} \right)} \right) \times 10^{14},2.95} \right)}}} \\ {r_{2} = {1.05 + {{mod}\ \left( {\left( \frac{\left( {{\max\left( {k_{7},k_{8},k_{9},k_{10},k_{11},k_{12}} \right)} \times t_{3}} \right)}{\left( {{\min\left( {k_{7},k_{8},k_{9},k_{10},k_{11},k_{12}} \right)} \times t_{4}} \right)} \right) \times 10^{14},2.95} \right)}}} \end{matrix} \right.} \right.$

where, k_(i), i=1, 2, . . . 32 is the i-th binary number of K, and r₀, r₁ and r₂ are the parameter values of the Hybrid mapping, the TLT mapping and the TST mapping respectively.

$\left\{ \begin{matrix} {a = {1./\left( {1 + e^{\frac{1}{256} \times {({{- t_{5}} \times {({k_{13} \oplus k_{14} \oplus k_{15}})}})}}} \right)}} \\ {b = {5./\left( {1 + e^{\frac{1}{256} \times {({{- t_{6}} \times {({k_{16} \oplus k_{17} \oplus k_{18}})}})}}} \right)}} \\ {c = \begin{matrix} {\frac{1}{2} \times \left( {{1.5/\left( {1 + e^{\frac{1}{256} \times {({{- t_{7}} \times {({k_{19} \oplus k_{20} \oplus k_{21}})}})}}} \right)} +} \right.} \\ \left. {2.8/\left( {1 + e^{\frac{1}{256} \times {({{- t_{8}} \times {({k_{22} \oplus k_{23} \oplus k_{24}})}})}}} \right)} \right) \end{matrix}} \end{matrix} \right.$

where, a, b, c are the parameter values of the ISEL mapping.

$\left\{ \begin{matrix} {Z_{1} = \begin{bmatrix} {t_{1} \times k_{25}} & {t_{3} \times k_{26}} \\ {t_{5} \times k_{27}} & {t_{7} \times k_{28}} \end{bmatrix}} \\ {Z_{2} = \begin{bmatrix} {t_{2} \times k_{29}} & {t_{4} \times k_{30}} \\ {t_{6} \times k_{31}} & {t_{8} \times k_{32}} \end{bmatrix}} \end{matrix} \right.$

The two matrices Z₁ and Z₂ are constructed according to the above formula, and then the Kronecker product of the two matrices is calculated to obtain Z₃.

$\begin{matrix} \left\{ \begin{matrix} {x_{0} = {{mod}\ \left( {\left( {{Z_{3}(1)} + {Z_{3}(2)} - \left\lfloor {{Z_{3}(1)} + {Z_{3}(2)}} \right\rfloor} \right) \times 10^{14},\ 1} \right)}} \\ {x_{00} = {{mod}\ \left( {\left( {{Z_{3}(3)} + {Z_{3}(4)} - \left\lfloor {{Z_{3}(3)} + {Z_{3}(4)}} \right\rfloor} \right) \times 10^{14},\ 1} \right)}} \\ {y_{00} = {{mod}\left( {\left( {{Z_{3}(1)} + {Z_{3}(3)} - \left\lfloor {{Z_{3}(1)} + {Z_{3}(3)}} \right\rfloor} \right) \times 10^{14},\ 1} \right)}} \\ {v_{0} = {{mod}\ \left( {\left( {{Z_{3}(2)} + {Z_{3}(4)} - \left\lfloor {{Z_{3}(2)} + {Z_{3}(4)}} \right\rfloor} \right) \times 10^{14},\ 1} \right)}} \end{matrix} \right. &  \end{matrix}$

where, └⋅┘ presents downward rounding, Z₃ (i), i=1, 2, 3, 4 represents the i-th element of the matrix Z₃, and x₀, x₀₀, y₀₀, v₀ are the initial values of the Hybrid mapping, the TLT mapping, the TSL mapping, and ISEL mapping respectively.

Step 2. obtaining subsampling rates of original coefficient matrices at all levels by using multi-scale block compressed sensing theory through a total target sampling rate of a plaintext image.

Step 3. substituting the parameters and initial values of the one-dimensional chaotic mapping into a corresponding chaotic system to generate chaotic sequences, transforming the chaotic sequences into a matrix form, and obtaining corresponding orthogonal basis matrices; and extracting some elements of the orthogonal basis matrices as the measurement matrices according to the subsampling rates.

For example, the parameter r₂ and initial value y₀₀ of the chaotic system generated in step 1 are substituted into the TST mapping, which iterates t+n₁×n_(i) times, r₁ and x₀₀ are substituted into the TLT mapping, which iterates t+n₂×n₂ times, and r₀ and x₀ are substituted into the Hybrid mapping, which iterates t+n₃×n₃ times, where n₁, n₂, and n₃ are determined by the block size given in advance. Every 2000 iterations, the sine value of the initial state is multiplied by a tiny coefficient to disturb the initial state value of the next iteration, and the corresponding chaotic sequences X₁, X₂, X₃ are obtained by discarding the first T elements. Where, X₁ is a sequence of a length n₁×n₁, X₂ is a sequence of a length n₂×n₂, and X₃ is a sequence of a length n₃×n₃. In order to strengthen the randomness of the chaotic sequences, the generated chaotic sequences are further processed. That is, the sequence is multiplied by an interference coefficient α, and then an interference coefficient β is added to obtain the sequences X₁′, X₂′, X₃′, where, α=−2 and β=1. The processed chaotic sequences X₁′, X₂′, X₃′ are transformed into a matrix form to obtain X₁″, X₂″, X₃″. Where, X₁″ is a n₁×n₁ matrix, X₂″ is a n₂×n₂ matrix, and X₃″ is a n₃×n₃ matrix. Then, the orthogonal basis matrices Φ₁, Φ₂, Φ₃ corresponding to X₁″, X₂″, X₃″ are used as redundant measurement matrices. The row dimensions n_(i), i=1, 2, 3 of the redundant measurement matrices are multiplied by the corresponding sampling rates to obtain new row dimensions m_(i), I=1, 2, 3, and then the first m_(i) rows of the redundant measurement matrices are extracted as the formal measurement matrices Φ₁′, Φ₂′, Φ₃′ respectively.

Step 4. performing three-level discrete wavelet transform on the plaintext image to obtain the original coefficient matrices at all levels, and blocking the original coefficient matrices at all levels to construct new coefficient matrixes at all levels.

For example, as shown in FIG. 2 , new coefficient matrices at all levels are constructed as a low-frequency coefficient matrix A₃ and nine high-frequency coefficient matrices H_(i), V_(i), D_(i), i=1, 2, 3 in horizontal, vertical and diagonal directions.

Step 5. using the chaotic sequences to generate index sequences, and scrambling the corresponding coefficient matrices at all levels as blocks;

For example, the array block_size with a length being 3 is given, and the numerical value of the element represents the block size. Third-level wavelet decomposition coefficient matrices H₃, V₃, D₃ are divided into block_size₃×block_size₃ blocks, second-level wavelet decomposition matrices H₂, V₂, D₂ are divided into block_size₂×block_size₂ blocks, first-level wavelet decomposition coefficient matrices H₁, V₁, D₁ are divided into block_size₁×block_size₁ blocks, and then each block matrix is expanded into column vectors after blocking. Finally, the corresponding column vectors are merged in turn to form nine new coefficient matrices NH₃, NV₃, ND₃, NH₂, NV₂, ND₂, NH₁, NV₁, ND₁.

The three chaotic sequences X₁′, X₂′ and X₃′ generated in step 3 are sorted in ascending order to obtain the corresponding index sequences Ind₁, Ind₂ and Ind₃. Third-level wavelet decomposition coefficient matrices A₃, NH₃, NV₃, ND₃ are scrambled by Ind₃ to obtain A₃′, H₃′, V₃′, D₃′, second-level wavelet decomposition coefficient matrices NH₂, NV₂, ND₂ are scrambled by Ind₂ to obtain H₂′, V₂′, D₂′, and first-level wavelet decomposition coefficient matrices NH₁, NV₁, ND₁ are scrambled by Ind₁ to obtain H₁′, V₁′, D₁′. Taking A₃ as an example, letting the matrix A₃ be an m×n matrix, expanding the matrix A₃ into a sequence with a length being m×n, wherein i is the index of the i-th element in the sequence. Wherein, A₃′ is the sequence after A₃ is scrambled.

A ₃′(Ind ₃(m×n−i+1))=A ₃(Ind ₃(i))

Step 6. using the measurement matrices to measure the coefficient matrices at all levels.

For example, the coefficient matrix A₃′ remains unchanged, and the coefficient matrices H₃′, V₃′, D₃′ are measured with Δ₃′ to obtain measured value matrices H₃″, V₃″, D₃″, the coefficient matrices H₂′, V₂′, D₂′ are measured with T₂′ to obtain measured value matrices H₂″, V₂″, D₂″; and the coefficient matrices H₁′, V₁′, D₁′ are measured with Φ₁′ to obtain measured value matrices H₁″, V₁″, D₁″.

Step 7. retaining low-frequency coefficient matrices, merging measured non-low frequency coefficient matrices at all levels to construct a matrix T, performing micro-processing on the matrix T to obtain a to-be-measured matrix NT, and respectively generating the row-state transition probability matrix and the column-state transition probability matrix according to the to-be-measured matrix NT;

$T = \begin{pmatrix} H_{1}^{''} & V_{1}^{''} & D_{1}^{''} \\ H_{2}^{''} & V_{2}^{''} & D_{2}^{''} \\ H_{3}^{''} & V_{3}^{''} & D_{3}^{''} \end{pmatrix}$

In order to enhance the randomness, the to-be-measured matrix T is microprocessed according to the information l₀, l₁, L₀, L₁ obtained in step 1 to obtain the matrix NT.

$\left\{ \begin{matrix} {{{NT} = {- T}},{l_{0} > l_{1}}} \\ {{{NT} = {T - {0.5}}},{L_{0} > L_{1}}} \\ {{{NT} = {T + {0.5}}},{L_{0} < L_{1}}} \end{matrix} \right.$

The row-state transition probability matrix and the column-state transition probability matrix are constructed by merging the element information of the matrix NT.

Step 8. performing SVD decomposition on the low-frequency coefficient matrices to obtain submatrices, and quantizing the elements in the submatrices and the non-low frequency coefficient matrices at all levels to a preset interval.

For example, the maximum value and the minimum value of the nine coefficient matrices H_(i)″, V_(i)″, D_(i)″, i=1, 2, 3 after wavelet decomposition at all levels are obtained respectively, and the coefficient matrices are quantized to an interval [0, 255]. After the quantification of the nine coefficient matrices H_(i)″, V_(i)″, D_(i)″, i=1, 2, 3 is completed, the nine corresponding coefficient matrices H_(i)′″, V_(i)′″, D_(i)′″, i=1, 2, 3 are obtained. SVD decomposition is performed on the low-frequency matrix A₃′ to obtain three submatrices with the same dimensions u, s, and vt, then the maximum and minimum values of the three submatrices are obtained respectively, the three sub-matrices u, s, and vt are quantized to the interval [0, 255], and the corresponding matrices U, S, VT are finally obtained.

Step 9. generating index values according to the information of the chaotic sequences and determining merging rules by the index values, firstly mering the non-low frequency coefficient matrices at all levels according to the merging rules to obtain an overall matrix, and then inserting the submatrices into different positions of the overall matrix.

For example, the coefficients in the same direction are merged into one group, and H₁′″, H₂′″, H₃′″ are grouped into one group, which is recorded as the first group. V₁′″, V₂′″, V₃′″ are grouped into one group, which is recorded as the second group. D₁′″, D₂′″, D₃′″ are grouped into one group, which is recorded as the third group. The three chaotic sequences X₁′, X₂′, X₃′ generated in step 3 are used for obtaining the index values.

$\left\{ \begin{matrix} {{Lind_{1}} = {\left( {{X_{1}^{\prime}\left( {n_{1} \times n_{1}} \right)} + {X_{2}^{\prime}\left( {n_{2} \times n_{2}} \right)} + {X_{3}^{\prime}\left( {n_{3} \times n_{3}} \right)}} \right)/3}} \\ {{Lind}_{1}^{\prime} = {{{floor}\left( {{mod}\ \left( {{abs}\left( {{Lin}d_{1}} \right) \times 10^{8},6} \right)} \right)} + 1}} \\ {{Lind}_{2} = {\left( {{X_{1}^{\prime}\left( {{n_{1} \times n_{1}} - 1} \right)} + {X_{2}^{\prime}\left( {{n_{2} \times n_{2}} - 1} \right)} + {X_{3}^{\prime}\left( {{n_{3} \times n_{3}} - 1} \right)}} \right)/3}} \\ {{Lind}_{2}^{\prime} = {{{floor}\left( {{mod}\ \left( {{{abs}\left( {{Lin}d_{2}} \right) \times 10^{8}},6} \right)} \right)} + 1}} \\ {{Lind}_{3}\  = {\left( {{X_{1}^{\prime}\left( {{n_{1} \times n_{1}} - 2} \right)} + {X_{2}^{\prime}\left( {{n_{2} \times n_{2}} - 2} \right)} + {X_{3}^{\prime}\left( {{n_{3} \times n_{3}} - 2} \right)}} \right)/3}} \\ {{Lind}_{3}^{\prime} = {{{floor}\left( {{mod}\ \left( {{{abs}\left( {{Lin}d_{3}} \right) \times 10^{8}},6} \right)} \right)} + 1}} \end{matrix} \right.$

That is, the index value Lind₁′ of the first group is determined by the last element of X₁′, X₂′, X₃′, the index value Lind₂′ of the second group is determined by the penultimate element of X₁′, X₂′, X₃′, and the index value Lind₃′ of the third group is determined by the antepenult element of X₁′, X₂′, X₃′. At the same time, the three index values are mapped to an interval [1,6], representing that there are six possible sorting orders for each group.

$\left\{ \begin{matrix} {{\begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix} = \begin{pmatrix} H_{3}^{\prime\prime\prime} \\ H_{2}^{\prime\prime\prime} \\ H_{1}^{\prime\prime\prime} \end{pmatrix}},{\begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix} = \begin{pmatrix} V_{3}^{\prime\prime\prime} \\ V_{2}^{\prime\prime\prime} \\ V_{1}^{\prime\prime\prime} \end{pmatrix}},{\begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix} = \begin{pmatrix} D_{3}^{\prime\prime\prime} \\ D_{2}^{\prime\prime\prime} \\ D_{1}^{\prime\prime\prime} \end{pmatrix}}} \\ {{\begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix} = \begin{pmatrix} H_{3}^{\prime\prime\prime} \\ H_{1}^{\prime\prime\prime} \\ H_{2}^{\prime\prime\prime} \end{pmatrix}},{\begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix} = \begin{pmatrix} V_{3}^{\prime\prime\prime} \\ V_{1}^{\prime\prime\prime} \\ V_{2}^{\prime\prime\prime} \end{pmatrix}},{\begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix} = \begin{pmatrix} D_{3}^{\prime\prime\prime} \\ D_{1}^{\prime\prime\prime} \\ D_{2}^{\prime\prime\prime} \end{pmatrix}}} \\ {{\begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix} = \begin{pmatrix} H_{2}^{\prime\prime\prime} \\ H_{3}^{\prime\prime\prime} \\ H_{1}^{\prime\prime\prime} \end{pmatrix}},{\begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix} = \begin{pmatrix} V_{2}^{\prime\prime\prime} \\ V_{3}^{\prime\prime\prime} \\ V_{1}^{\prime\prime\prime} \end{pmatrix}},{\begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix} = \begin{pmatrix} D_{2}^{\prime\prime\prime} \\ D_{3}^{\prime\prime\prime} \\ D_{1}^{\prime\prime\prime} \end{pmatrix}}} \\ {{\begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix} = \begin{pmatrix} H_{2}^{\prime\prime\prime} \\ H_{1}^{\prime\prime\prime} \\ H_{3}^{\prime\prime\prime} \end{pmatrix}},{\begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix} = \begin{pmatrix} V_{2}^{\prime\prime\prime} \\ V_{1}^{\prime\prime\prime} \\ V_{3}^{\prime\prime\prime} \end{pmatrix}},{\begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix} = \begin{pmatrix} D_{2}^{\prime\prime\prime} \\ D_{1}^{\prime\prime\prime} \\ D_{3}^{\prime\prime\prime} \end{pmatrix}}} \\ {{\begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix} = \begin{pmatrix} H_{1}^{\prime\prime\prime} \\ H_{3}^{\prime\prime\prime} \\ H_{2}^{\prime\prime\prime} \end{pmatrix}},{\begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix} = \begin{pmatrix} V_{1}^{\prime\prime\prime} \\ V_{3}^{\prime\prime\prime} \\ V_{2}^{\prime\prime\prime} \end{pmatrix}},{\begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix} = \begin{pmatrix} D_{1}^{\prime\prime\prime} \\ D_{3}^{\prime\prime\prime} \\ D_{2}^{\prime\prime\prime} \end{pmatrix}}} \\ {{\begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix} = \begin{pmatrix} H_{1}^{\prime\prime\prime} \\ H_{2}^{\prime\prime\prime} \\ H_{3}^{\prime\prime\prime} \end{pmatrix}},{\begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix} = \begin{pmatrix} V_{1}^{\prime\prime\prime} \\ V_{2}^{\prime\prime\prime} \\ V_{3}^{\prime\prime\prime} \end{pmatrix}},{\begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix} = \begin{pmatrix} D_{1}^{\prime\prime\prime} \\ D_{2}^{\prime\prime\prime} \\ D_{3}^{\prime\prime\prime} \end{pmatrix}}} \end{matrix} \right.$

where, a first group of sorted matrices are marked as Y₁, and three internal block matrices are marked as Y₁₁, Y₁₂, Y₁₃ respectively; a second group of sorted matrices are marked as Y₂, and three internal block matrices are marked as Y₂₁, Y₂₂, Y₂₃ respectively; and a third group of sorted matrices are marked as Y₃, and three internal block matrices are marked as Y₃₁, Y₃₂, Y₃₃ respectively.

The quantized matrices U, S, VT are inserted into the first round of merged matrices respectively. That is, the matrix U is inserted into the first group Y₁, the matrix S is inserted into the second group Y₂, and the matrix VT is inserted into the third group Y₃. The three chaotic sequences X₁′, X₂′, X₃′ generated in step 3 are used for obtaining the index value.

$\begin{matrix} \left\{ \begin{matrix} {{Hind_{1}} = {\left( {{X_{1}^{\prime}(1)} + {X_{2}^{\prime}(1)} + {X_{3}^{\prime}(1)}} \right)/3}} \\ {{Hind}_{2}\  = {\left( {{X_{1}^{\prime}(2)} + {X_{2}^{\prime}(2)} + {X_{3}^{\prime}(2)}} \right)/3}} \\ {{Hind}_{3}\  = {\left( {{X_{1}^{\prime}(3)} + {X_{2}^{\prime}(3)} + {X_{3}^{\prime}(3)}} \right)/3}} \\ {{Hind}_{1}^{\prime} = {{{floor}\left( {{mod}\ \left( {{abs}\left( {{Hin}d_{1}} \right) \times 10^{8},4} \right)} \right)} + 1}} \\ {{Hind}_{2}^{\prime} = {{{floor}\left( {{mod}\left( {{{abs}\left( {Hind_{2}} \right)} \times 10^{8},4} \right)} \right)} + 1}} \\ {{Hind}_{3}^{\prime} = {{{floor}\left( {{mod}\left( {{{abs}\left( {Hind_{3}} \right)} \times 10^{8},\ 4} \right)} \right)} + 1}} \end{matrix} \right. &  \end{matrix}$

That is, the index value Hind1′ of the first group is determined by the first element of X₁′, X₂′, X₃′, the index value Hind1′ of the second group is determined by the second element of X₁′, X₂′, X₃′, and the index value Hind1′ of the third group is determined by the third element of X₁′, X₂′, X₃′. At the same time, the three index values are mapped to an interval [1,4], representing that the three matrices U, S, and VT have four insertion positions respectively, that is, the top of each matrix group, between the two adjacent block matrices in the group, and the bottom of the matrix group. The results are as follows:

$\left\{ \begin{matrix} {{Y_{1}^{\prime} = \begin{pmatrix} U \\ Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix}},{Y_{2}^{\prime} = \begin{pmatrix} S \\ Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix}},{Y_{3}^{\prime} = \begin{pmatrix} {VT} \\ Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix}}} \\ {{Y_{1}^{\prime} = \begin{pmatrix} Y_{11} \\ U \\ Y_{12} \\ Y_{13} \end{pmatrix}},{Y_{2}^{\prime} = \begin{pmatrix} Y_{21} \\ S \\ Y_{22} \\ Y_{23} \end{pmatrix}},{Y_{3}^{\prime} = \begin{pmatrix} Y_{31} \\ {VT} \\ Y_{32} \\ Y_{33} \end{pmatrix}}} \\ {{Y_{1}^{\prime} = \begin{pmatrix} Y_{11} \\ Y_{12} \\ U \\ Y_{13} \end{pmatrix}},{Y_{2}^{\prime} = \begin{pmatrix} Y_{21} \\ Y_{22} \\ S \\ Y_{23} \end{pmatrix}},{Y_{3}^{\prime} = \begin{pmatrix} Y_{31} \\ Y_{32} \\ {VT} \\ Y_{33} \end{pmatrix}}} \\ {{Y_{1}^{\prime} = \begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \\ U \end{pmatrix}},{Y_{2}^{\prime} = \begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \\ S \end{pmatrix}},{Y_{3}^{\prime} = \begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \\ {VT} \end{pmatrix}}} \end{matrix} \right.$

Where, a first group of merged matrices are marked as Y₁′, a second group of merged matrices are marked as Y₂′, and a third group of merged matrices are marked as Y₃′. The three matrices Y₁′, Y₂′ and Y₃′ are merged, and the merged matrix is recorded as a matrix T′.

T′=(Y ₁ ′Y ₂ ′Y ₃′)

Step 10. adjusting the dimension of the overall matrix, acquiring the element information of the overall matrix, and generating control parameters for secondary scrambling.

For example, assuming that the dimension of the merged matrix is m×n, two factors m₁ and n₁ of m×n are found, so that m₁×n₁=M×n, meanwhile, |m₁−n₁| is the minimum, and then the dimension of the matrix is adjusted to m₁×n₁. Then the matrix information is obtained as follows.

$\left\{ \begin{matrix} {{Max} = {\max\left( T^{\prime} \right)}} \\ {{Min} = {\min\left( T^{\prime} \right)}} \\ {d_{1} = {{floor}\left( {{mean}\ \left( T^{\prime} \right)} \right)}} \\ {d_{2} = \ {{ceil}\left( {\left( {\max + \min} \right)/2} \right)}} \\ {d_{1}^{\prime} = {{mod}\left( {d_{1},10} \right)}} \\ {d_{2}^{\prime} = {{mod}\left( {d_{2}\ ,10} \right)}} \\ {d_{12} = {\max\left( {d_{1}^{\prime},d_{2}^{\prime}} \right)}} \end{matrix} \right.$

where, Max is the maximum value of the matrix T′, Min is the minimum value of the matrix T′, d₁ is the maximum integer less than or equal to the average value of elements in the matrix T′, d₂ is the minimum integer greater than or equal to the average value of Max and Min, d₁′ is the remainder of d₁ divided by 10, d₂′ is the remainder of d₂ divided by 10, and d₁₂ is the larger of d1′ and d2′.

Step 11. scrambling the merged overall matrix according to the row-state transition probability matrix and the column-state transition probability matrix, and simultaneously setting corresponding flag bits;

For example, the parameters a, b, c and the initial value v₀ generated in step 1 are substituted into the ISEL mapping, which iterates t+(d₁₂+1)×m₁×n₁, and every 2000 iterations, the sine value of the initial state is multiplied by the tiny coefficient to disturb the initial state value of the next iteration. One chaotic sequence V is generated by discarding the first t elements. In order to strengthen the randomness, the sequence V is further processed. That is, the sequence is multiplied by the interference coefficient α, and then the interference coefficient β is added to obtain the sequence V′, where, α=−4, and β=1. Then, the four subsequences V₁, V₂, V₃ and V₄ are generated according to the chaotic sequence V′.

$\left\{ \begin{matrix} {V_{1} = {{10 \times V^{\prime}} - {{round}\ \left( {10 \times V^{\prime}} \right)}}} \\ {V_{2} = {{10^{2} \times V^{\prime}} - {{round}\ \left( {10^{2} \times V^{\prime}} \right)}}} \\ {V_{3} = {{10^{3} \times V^{\prime}} - {{round}\ \left( {10^{3} \times V^{\prime}} \right)}}} \\ {V_{4} = {{10^{4} \times V^{\prime}} - {{round}\ \left( {10^{4} \times V^{\prime}} \right)}}} \end{matrix} \right.$

where, round is a rounding function.

According to V₁, V₂, V₃ and V₄, control parameters for the scrambling process are generated, and the calculation process is as follows.

$\left\{ \begin{matrix} {w_{1} = {{fix}\left( {{mod}\left( {{{V_{1}\left( {m_{1}^{\prime} + n_{1}^{\prime}} \right)} + 1},5} \right)} \right)}} \\ {w_{2} = {{fix}\left( {{mod}\left( {V_{2}\left( {{{{round}{}\left( {{m_{1}^{\prime}/2} + {n_{1}^{\prime}/2}} \right)} + {2 \times 10^{2}}},5^{2}} \right)} \right)} \right.}} \\ {w_{3} = {{fix}\left( {{mod}\left( {V_{3}\left( {{abs}\left( {{{{round}{}\left( {{m_{1}^{\prime}/3} + {n_{1}^{\prime}/3}} \right)} + {3 \times 10^{3}}},5^{3}} \right)} \right)} \right.} \right.}} \\ {w_{4} = {{fix}\left( {{mod}\left( {V_{4}\left( {{abs}\left( {{{{round}{}\left( {{m_{1}^{\prime}/4} + {n_{1}^{\prime}/4}} \right)} + {4 \times 10^{4}}},5^{4}} \right)} \right)} \right.} \right.}} \end{matrix} \right.$

where, w₁-w₄ are used as control parameters for subsequent shift operation, and fix is a rounding function to zero. Where, m₁′ is a maximum prime factor of a matrix row dimension m₁, and n₁′ is a maximum prime factor of a matrix column dimension n₁.

Step 12. performing independent diffusion on the elements of the overall matrix by using one of the chaotic sequences, and performing global diffusion on the elements of the overall matrix by using the other chaotic sequences to obtain the final encrypted image.

For example, the column vectors are scrambled according to the row-state transition probability matrix generated in step 7. If the column of the selected number corresponds to a positive odd number, the moving digit of the matrix element is w₁; if the column of the selected number corresponds to a negative odd number, the moving digit of the matrix element is w₃; if the column of the selected number corresponds to a positive even number, the moving digit of the matrix element is w₂; and if the column of the selected number corresponds to a negative even number, the moving digit of the matrix element is w₄. The scrambled matrix is set to T″. The initial value of the state transition flag bit matrix is set to 0. If the element in the corresponding position is shifted, the flag bit of the corresponding position changes from 0 to 1.

The row vectors are scrambled according to the column-state transition probability matrix generated in step 7, and the rules are the same as those in the above steps. The scrambled matrix is set to T′″. Similarly, the initial flag bit matrix is set, and if the corresponding position is shifted, the flag bit of the corresponding position changes from 0 to 1.

The chaotic sequence V′ generated in step 11 is quantized to an interval [0,255] to obtain the sequence V″. The d₁′ and d₂′ obtained in step 10 are used as samplings interval of the chaotic sequences, the sequence V1′ is obtained by sampling V″ at the interval of d₁′, and the sequence V₂′ is obtained by sampling V″ at an interval of d₂′. The position of the last element of the sequence V₂′ is taken as the starting position, and the continuous m₁×n₁ data are taken backward from the sequence V″, and are recorded as a sequence V₀. The image matrix T′″ is XOR with the sequence V₀ to obtain the matrix T″″. T″″ is recorded as the matrix A.

The sequence V₁′ is used for performing forward additive modulo operation on the matrix A to obtain a matrix B, and then the previous element of each element in the matrix B is used for performing cyclic left shift operation to obtain B′; V₂′ is used for performing backward additive modulo operation on the matrix B′ to obtain a matrix C, and then the latter element of each element in the matrix C is used for performing cyclic left shift operation to obtain C′. Thus, the final encrypted image is obtained.

The present disclosure discloses an image encryption method based on multi-scale compressed sensing and a Markov model. According to the difference in information carried by low-frequency coefficients and high-frequency coefficients of an image, different sampling rates are set for the low-frequency coefficients and the high-frequency coefficients of the image, which can effectively improve the reconstruction quality of a decrypted image. In addition, by merging the chaotic system and the Markov model, the encryption process is completed by firstly scrambling in the coefficient matrices of the image, then scrambling between the coefficient matrices of the image, and finally performing independent diffusion and global diffusion. 

What is claimed is:
 1. An image encryption method based on multi-scale compressed sensing and a Markov model, comprising: generating parameters and initial values of one-dimensional chaotic mapping according to plaintext image information; obtaining subsampling rates of original coefficient matrices at all levels by using multi-scale block compressed sensing theory through a total target sampling rate of a plaintext image; substituting the parameters and initial values of the one-dimensional chaotic mapping into a corresponding chaotic system to generate chaotic sequences, transforming the chaotic sequences into a matrix form, and obtaining corresponding orthogonal basis matrices, and extracting some elements of the orthogonal basis matrices as measurement matrices according to the subsampling rates; performing three-level discrete wavelet transform on the plaintext image to obtain the original coefficient matrices at all levels, and blocking the original coefficient matrices at all levels to construct new coefficient matrixes at all levels; using the chaotic sequences to generate index sequences, and scrambling the corresponding coefficient matrices at all levels as blocks; using the measurement matrices to measure the coefficient matrices at all levels; retaining low-frequency coefficient matrices, merging measured non-low frequency coefficient matrices at all levels to construct a matrix T, performing micro-processing on the matrix T to obtain a to-be-measured matrix NT, and respectively generating a row-state transition probability matrix and a column-state transition probability matrix according to the to-be-measured matrix NT; performing SVD decomposition on the low-frequency coefficient matrices to obtain submatrices, and quantizing the elements in the submatrices and the non-low frequency coefficient matrices at all levels to a preset interval; generating index values according to the information of the chaotic sequences and determining merging rules by the index values, firstly mering the non-low frequency coefficient matrices at all levels according to the merging rules to obtain an overall matrix, and then inserting the submatrices into different positions of the overall matrix; adjusting the dimension of the overall matrix, acquiring the element information of the overall matrix, and generating control parameters for secondary scrambling; scrambling the merged overall matrix according to the row-state transition probability matrix and the column-state transition probability matrix, and simultaneously setting corresponding flag bits; and performing independent diffusion of elements on the the overall matrix by using one of the chaotic sequences, and performing global diffusion on elements of the overall matrix by using the other chaotic sequences to obtain a final encrypted image.
 2. The image encryption method based on multi-scale compressed sensing and a Markov model of claim 1, wherein a specific method of generating parameters and initial values of one-dimensional chaotic mapping according to plaintext image information is as follows: $r_{0} = \left\{ \begin{matrix} {{r_{end} - \frac{{mod}\left( {{\left( {\frac{l_{0}}{L_{0}} + \frac{l_{1}}{L_{1}}} \right) \times r_{end} \times 10},1} \right)}{10}},{{\left( {\frac{l_{0}}{L_{0}} + \frac{l_{1}}{L_{1}}} \right) \times r_{end} \times 10} > r_{end}}} \\ {{\left( {\frac{l_{0}}{L_{0}} + \frac{l_{1}}{L_{1}}} \right) \times r_{end} \times 10},{{\left( {\frac{l_{0}}{L_{0}} + \frac{l_{1}}{L_{1}}} \right) \times r_{end} \times 10} \leq r_{end}}} \end{matrix} \right.$ where, L₀ and L₁ are the numbers of 0 and 1 in a hash value K of the plaintext image respectively, l₀ and l₁ are a length of a longest continuous 0 sequence and a length of a longest continuous 1 sequence respectively, r_(end) is a right endpoint of a chaotic interval, and r₀ is a certain value of the chaotic interval; $\left\{ \begin{matrix} {r_{1} = {r_{start} + {{mod}\left( {{\left( \frac{\left( {{\max\left( {k_{1},k_{2},k_{3},k_{4},k_{5},k_{6}} \right)} \times t_{1}} \right)}{\left( {{\min\left( {k_{1},k_{2},k_{3},k_{4},k_{5},k_{6}} \right)} \times t_{2}} \right)} \right) \times 10^{14}},{r_{end} - r_{start}}} \right)}}} \\ {r_{2} = {r_{start} + {{mod}\left( {{\left( \frac{\left( {{\max\left( {k_{7},k_{8},k_{9},k_{10},k_{11},k_{12}} \right)} \times t_{3}} \right)}{\left( {{\min\left( {k_{7},k_{8},k_{9},k_{10},k_{11},k_{12}} \right)} \times t_{4}} \right)} \right) \times 10^{14}},{r_{end} - r_{start}}} \right)}}} \end{matrix} \right.$ where, k_(i), i=1, 2, . . . , 12 is the i-th binary number of K, t₁-t₄ is an external key, r_(start) is a left endpoint of the chaotic interval, r_(end) is the right endpoint of the chaotic interval, r₁ and r₂ are some values of the chaotic interval; $\left\{ \begin{matrix} {a = \frac{r_{end}}{\left( {1 + e^{\frac{1}{256} \times {({{- t_{5}} \times {({k_{13} \oplus k_{14} \oplus k_{15}})}})}}} \right)}} \\ {b = \frac{r_{end}}{\left( {1 + e^{\frac{1}{256} \times {({{- t_{6}} \times {({k_{16} \oplus k_{17} \oplus k_{18}})}})}}} \right)}} \\ {c = {\frac{1}{2} \times \left( {\frac{r_{start}}{\left( {1 + e^{\frac{1}{256} \times {({{- t_{7}} \times {({k_{19} \oplus k_{20} \oplus k_{21}})}})}}} \right)} + \frac{r_{end}}{\left( {1 + e^{\frac{1}{256} \times {({{- t_{8}} \times {({k_{22} \oplus k_{23} \oplus k_{24}})}})}}} \right)}} \right)}} \end{matrix} \right.$ where, k_(i), i=13, 14, . . . , 24 is the i-th binary number of K, t₅-t₈ is an external key, r_(start) is the left endpoint of the chaotic interval, r_(end) is the right endpoint of the chaotic interval, and a, b and c are some values of the chaotic interval; $\left\{ \begin{matrix} {Z_{1} = \begin{bmatrix} {t_{1} \times k_{25}} & {t_{3} \times k_{26}} \\ {t_{5} \times k_{27}} & {t_{7} \times k_{28}} \end{bmatrix}} \\ {Z_{2} = \begin{bmatrix} {t_{2} \times k_{29}} & {t_{4} \times k_{30}} \\ {t_{6} \times k_{31}} & {t_{8} \times k_{32}} \end{bmatrix}} \end{matrix} \right.$ where, k_(i), i=25, 14, . . . , 32 is the i-th binary number of K, t₁-t₈ is an external key, and Z₁ and Z₂ are transition matrices; $\left\{ \begin{matrix} {x_{0} = {{mod}\left( {{\left( {{Z_{3}(1)} + {Z_{3}(2)} - \left\lfloor {{Z_{3}(1)} + {Z_{3}(2)}} \right\rfloor} \right) \times 10^{14}},1} \right)}} \\ {x_{00} = {{mod}\left( {{\left( {{Z_{3}(3)} + {Z_{3}(4)} - \left\lfloor {{Z_{3}(3)} + {Z_{3}(4)}} \right\rfloor} \right) \times 10^{14}},1} \right)}} \\ {y_{00} = {{mod}\left( {{\left( {{Z_{3}(1)} + {Z_{3}(3)} - \left\lfloor {{Z_{3}(1)} + {Z_{3}(3)}} \right\rfloor} \right) \times 10^{14}},1} \right)}} \\ {v_{0} = {{mod}\left( {{\left( {{Z_{3}(2)} + {Z_{3}(4)} - \left\lfloor {{Z_{3}(2)} + {Z_{3}(4)}} \right\rfloor} \right) \times 10^{14}},1} \right)}} \end{matrix} \right.$ where, └⋅┘ presents downward rounding, Z₃ is a Kronecker product of transition Z₁ and transition Z₂, Z₃ (i), i=1, 2, 3, 4 represents the i-th element of the matrix Z₃, and x₀, x₀₀, y₀₀, v₀ are the initial values of the corresponding chaotic mapping, respectively.
 3. The image encryption method based on multi-scale compressed sensing and a Markov model of claim 1, wherein a specific method of scrambling the corresponding coefficient matrices at all levels as the blocks comprises: letting a matrix A₃ be an m×n matrix, expanding the matrix A₃ into a sequence with a length being m×n, wherein i is the index of the i-th element in the sequence, a scrambling method of which is as follows: A ₃′(Ind ₃(m×n−i+1))=A ₃(Ind ₃(i)) where, A₃′ is a sequence after A₃ is scrambled, and Ind₃ is an index sequence for scrambling third-level wavelet decomposition coefficient matrices; and similarly, other coefficient matrices H_(i)′, V_(i)′, D_(i)′, i=1, 2, 3 after scrambling are obtained.
 4. The image encryption method based on multi-scale compressed sensing and a Markov model of claim 1, wherein a specific method of performing micro-processing on the matrix T to obtain the to-be-measured matrix NT is as follows: $T = \begin{pmatrix} H_{1}^{''} & V_{1}^{''} & D_{1}^{''} \\ H_{2}^{''} & V_{2}^{''} & D_{2}^{''} \\ H_{3}^{''} & V_{3}^{''} & D_{3}^{''} \end{pmatrix}$ where, H_(i)″, V_(i)″, D_(i)″, i=1, 2, 3 are coefficient matrices after H_(i)′, V_(i)′, D_(i)′, i=1, 2, 3 are compressed, and T is a coefficient merging matrix; $\left\{ \begin{matrix} {{{NT}\  = {- T}},{l_{0} > l_{1}}} \\ {{{NT}\  = {T - {0\text{.5}}}},{L_{0} > L_{1}}} \\ {{{NT}\  = {T + {0\text{.5}}}},{L_{0} < L_{1}}} \end{matrix} \right.$ where, L₀ and L₁ are the numbers of 0 and 1 in the hash value K of the plaintext image respectively, l₀ and l₁ are the length of the longest continuous 0 sequence and the length of the longest continuous 1 sequence respectively, and NT is the to-be-measured matrix after processing T.
 5. The image encryption method based on multi-scale compressed sensing and a Markov model of claim 1, wherein a specific method of firstly mering the non-low frequency coefficient matrices at all levels according to the merging rules to obtain the overall matrix is as follows: $\left\{ \begin{matrix} {{Lind_{1}} = {\left( {{X_{1}^{\prime}\left( {n_{1} \times n_{1}} \right)} + {X_{2}^{\prime}\left( {n_{2} \times n_{2}} \right)} + {X_{3}^{\prime}\left( {n_{3} \times n_{3}} \right)}} \right)/3}} \\ {{Lind}_{1}^{\prime} = {{{floor}\left( {{mod}\left( {{{{abs}\left( {{Lin}d_{1}} \right)} \times 10^{8}},6} \right)} \right)} + 1}} \\ {{Lind}_{2}\  = {\left( {{X_{1}^{\prime}\left( {{n_{1} \times n_{1}} - 1} \right)} + {X_{2}^{\prime}\left( {{n_{2} \times n_{2}} - 1} \right)} + {X_{3}^{\prime}\left( {{n_{3} \times n_{3}} - 1} \right)}} \right)/3}} \\ {{Lind_{2}} = {{{floor}\left( {{mod}\left( {{{{abs}\left( {{Lin}d_{2}} \right)} \times 10^{8}},6} \right)} \right)} + 1}} \\ {{Lind}_{3}\  = {\left( {{X_{1}^{\prime}\left( {{n_{1} \times n_{1}} - 1} \right)} + {X_{2}^{\prime}\left( {{n_{2} \times n_{2}} - 1} \right)} + {X_{3}^{\prime}\left( {{n_{3} \times n_{3}} - 1} \right)}} \right)/3}} \\ {{Lind}_{3}^{\prime} = {{{floor}\left( {{mod}\left( {{{{abs}\left( {{Lin}d_{3}} \right)} \times 10^{8}},6} \right)} \right)} + 1}} \end{matrix} \right.$ where, Lind_(i), i=1, 2, 3 is an index value generated by the chaotic sequence X₁′, i=1, 2, 3, n_(i)×n_(i), i=1, 2, 3 is a length of X₁′, i=1, 2, 3, and Lind₁′, i=1, 2, 3 is a result of mapping Lind_(i), i=1, 2, 3 to an interval [1, 6]; $\left\{ \begin{matrix} {{\begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix} = \begin{pmatrix} H_{3}^{\prime''} \\ H_{2}^{\prime''} \\ H_{1}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix} = \begin{pmatrix} V_{3}^{\prime''} \\ V_{2}^{\prime''} \\ V_{1}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix} = \begin{pmatrix} D_{3}^{\prime''} \\ D_{2}^{\prime''} \\ D_{1}^{\prime''} \end{pmatrix}}} \\ {{\begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix} = \begin{pmatrix} H_{3}^{\prime''} \\ H_{1}^{\prime''} \\ H_{2}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix} = \begin{pmatrix} V_{3}^{\prime''} \\ V_{1}^{\prime''} \\ V_{2}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix} = \begin{pmatrix} D_{3}^{\prime''} \\ D_{1}^{\prime''} \\ D_{2}^{\prime''} \end{pmatrix}}} \\ {{\begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix} = \begin{pmatrix} H_{2}^{\prime''} \\ H_{3}^{\prime''} \\ H_{1}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix} = \begin{pmatrix} V_{2}^{\prime''} \\ V_{3}^{\prime''} \\ V_{1}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix} = \begin{pmatrix} D_{2}^{\prime''} \\ D_{3}^{\prime''} \\ D_{1}^{\prime''} \end{pmatrix}}} \\ {{\begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix} = \begin{pmatrix} H_{2}^{\prime''} \\ H_{1}^{\prime''} \\ H_{3}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix} = \begin{pmatrix} V_{2}^{\prime''} \\ V_{1}^{\prime''} \\ V_{3}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix} = \begin{pmatrix} D_{2}^{\prime''} \\ D_{1}^{\prime''} \\ D_{3}^{\prime''} \end{pmatrix}}} \\ {{\begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix} = \begin{pmatrix} H_{1}^{\prime''} \\ H_{3}^{\prime''} \\ H_{2}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix} = \begin{pmatrix} V_{1}^{\prime''} \\ V_{3}^{\prime''} \\ V_{2}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix} = \begin{pmatrix} D_{1}^{\prime''} \\ D_{3}^{\prime''} \\ D_{2}^{\prime''} \end{pmatrix}}} \\ {{\begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix} = \begin{pmatrix} H_{1}^{\prime''} \\ H_{2}^{\prime''} \\ H_{3}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix} = \begin{pmatrix} V_{1}^{\prime''} \\ V_{2}^{\prime''} \\ V_{3}^{\prime''} \end{pmatrix}},{\begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix} = \begin{pmatrix} D_{1}^{\prime''} \\ D_{2}^{\prime''} \\ D_{3}^{\prime''} \end{pmatrix}}} \end{matrix} \right.$ where, H_(i)′″, V_(i)′″, D_(i)′″, i=1, 2, 3 is a result of quantizing H_(i)″, V_(i)″, D_(i)″, i=1, 2, 3 to [0, 255], a first group of sorted matrices are marked as Y₁, three internal block matrices are marked as Y₁₁, Y₁₂, Y₁₃ respectively, and a sorting order is determined by Lind₁′; a second group of sorted matrices are marked as Y₂, three internal block matrices are marked as Y₂₁, Y₂₂, Y₂₃, and a sorting order is determined by Lind₂′; and a third group of sorted matrices are marked as Y₃, three internal block matrices are marked as Y₃₁, Y₃₂, Y₃₃, and a sorting order is determined by Lind₃′ D.
 6. The image encryption method based on multi-scale compressed sensing and a Markov model of claim 1, wherein a specific method of inserting the submatrices into different positions of the overall matrix is as follows: $\left\{ \begin{matrix} {{Hind_{1}} = {\left( {{X_{1}^{\prime}(1)} + {X_{2}^{\prime}(1)} + {X_{3}^{\prime}(1)}} \right)/3}} \\ {{Hind}_{2}\  = {\left( {{X_{1}^{\prime}(2)} + {X_{2}^{\prime}(2)} + {X_{3}^{\prime}(2)}} \right)/3}} \\ {{Hind}_{3}\  = {\left( {{X_{1}^{\prime}(3)} + {X_{2}^{\prime}(3)} + {X_{3}^{\prime}(3)}} \right)/3}} \\ {{Hind_{1}} = {{{floor}\left( {{mod}\left( {{{{abs}\left( {{Hin}d_{1}} \right)} \times 10^{8}},4} \right)} \right)} + 1}} \\ {{Hind_{2}} = {{{floor}\left( {{mod}\left( {{{{abs}\left( {{Hin}d_{2}} \right)} \times 10^{8}},4} \right)} \right)} + 1}} \\ {{Hind_{3}} = {{{floor}\left( {{mod}\left( {{{{abs}\left( {{Hin}d_{3}} \right)} \times 10^{8}},4} \right)} \right)} + 1}} \end{matrix} \right.$ where, Hind_(i), i=1, 2, 3 is an index value generated by the chaotic sequence X₁′, i=1, 2, 3, and Hind₁′, i=1, 2, 3 is a result of mapping Hind_(i), i=1, 2, 3 to the interval [1, 4]; $\left\{ \begin{matrix} {{Y_{1}^{\prime} = \begin{pmatrix} U \\ Y_{11} \\ Y_{12} \\ Y_{13} \end{pmatrix}}\ ,{Y_{2}^{\prime} = \begin{pmatrix} S \\ Y_{21} \\ Y_{22} \\ Y_{23} \end{pmatrix}},{Y_{3}^{\prime} = \begin{pmatrix} {VT} \\ Y_{31} \\ Y_{32} \\ Y_{33} \end{pmatrix}}} \\ {{Y_{1}^{\prime} = \begin{pmatrix} Y_{11} \\ U \\ Y_{12} \\ Y_{13} \end{pmatrix}}\ ,{Y_{2}^{\prime} = \begin{pmatrix} Y_{21} \\ S \\ Y_{22} \\ Y_{23} \end{pmatrix}},{Y_{3}^{\prime} = \begin{pmatrix} Y_{31} \\ {VT} \\ Y_{32} \\ Y_{33} \end{pmatrix}}} \\ {{Y_{1}^{\prime} = \begin{pmatrix} Y_{11} \\ Y_{12} \\ U \\ Y_{13} \end{pmatrix}}\ ,{Y_{2}^{\prime} = \begin{pmatrix} Y_{21} \\ Y_{22} \\ S \\ Y_{23} \end{pmatrix}},{Y_{3}^{\prime} = \begin{pmatrix} Y_{31} \\ Y_{32} \\ {VT} \\ Y_{33} \end{pmatrix}}} \\ {{Y_{1}^{\prime} = \begin{pmatrix} Y_{11} \\ Y_{12} \\ Y_{13} \\ U \end{pmatrix}}\ ,{Y_{2}^{\prime} = \begin{pmatrix} Y_{21} \\ Y_{22} \\ Y_{23} \\ S \end{pmatrix}},{Y_{3}^{\prime} = \begin{pmatrix} Y_{31} \\ Y_{32} \\ Y_{33} \\ {VT} \end{pmatrix}}} \end{matrix} \right.$ $T^{\prime} = \begin{pmatrix} Y_{1}^{\prime} & Y_{2}^{\prime} & Y_{3}^{\prime} \end{pmatrix}$ where, Y₁′ is a matrix after the first group merging, and the sorting order is determined by Hind₁′; Y₂′ is a matrix after the second group merging, and the sorting order is determined by Hind₂′; Y₃′ is a matrix after the third group merging, and the sorting order is determined by Hind₃′; T′ is a matrix after Y₁′, Y₂′ and Y₃′ are merged; and U, S and VT are three submatrices obtained by SVD decomposition of the low-frequency coefficient matrices at levels.
 7. The image encryption method based on multi-scale compressed sensing and a Markov model of claim 1, wherein a specific method of adjusting the dimension of the overall matrix and acquiring the element information of the overall matrix is as follows: $\left\{ \begin{matrix} {{Max} = {\max\left( T^{\prime} \right)}} \\ {{Min} = {\min\left( T^{\prime} \right)}} \\ {d_{1} = {{floor}\left( {{mean}\left( T^{\prime} \right)} \right)}} \\ {d_{2} = {{ceil}\left( {\left( {{Max} + {Min}} \right)/2} \right)}} \\ {d_{1}^{\prime} = {{mod}\left( {d_{1},{10}} \right)}} \\ {d_{2}^{\prime} = {{mod}\left( {d_{2},10} \right)}} \\ {d_{12}^{\prime} = {\max\left( {d_{1}^{\prime},d_{2}^{\prime}} \right)}} \end{matrix} \right.$ where, Max is the maximum value of the matrix T′, Min is the minimum value of the T′, d₁ is the maximum integer less than or equal to the average value of elements in the T′, d₂ is the minimum integer greater than or equal to the average value of Max and Min, d₁′ is the remainder of d₁ divided by 10, d₂′ is the remainder of d₂ divided by 10, and d₁₂ is the larger of d1′ and d2′.
 8. The image encryption method based on multi-scale compressed sensing and a Markov model of claim 1, wherein a specific method of generating the control parameters for secondary scrambling is as follows: $\left\{ \begin{matrix} {V_{1} = {{10 \times V^{\prime}} - {{round}\left( {10 \times V} \right)}}} \\ {V_{2} = {{10^{2} \times V^{\prime}} - {{round}\left( {10^{2} \times V} \right)}}} \\ {V_{3} = {{10^{3} \times V^{\prime}} - {{round}\left( {10^{3} \times V} \right)}}} \\ {V_{4} = {{10^{4} \times V^{\prime}} - {{round}\left( {10^{4} \times V} \right)}}} \end{matrix} \right.$ where, V′ is a generated and processed chaotic sequence, and V_(i), i=1, 2, 3, 4 is a subsequence generated by V′; $\left\{ \begin{matrix} {w_{1} = {{fix}\left( {{mod}\left( {{{V_{1}\left( {m_{1}^{\prime} + n_{1}^{\prime}} \right)} + 1},5} \right)} \right)}} \\ {w_{2} = {{fix}\left( {{mod}\left( {V_{2}\left( {{{{round}{}\left( {{m_{1}^{\prime}/2} + {n_{1}^{\prime}/2}} \right)} + {2 \times 10^{2}}},5^{2}} \right)} \right)} \right.}} \\ {w_{3} = {{fix}\left( {{mod}\left( {V_{3}\left( {{abs}\left( {{{{round}{}\left( {{m_{1}^{\prime}/3} + {n_{1}^{\prime}/3}} \right)} + {3 \times 10^{3}}},5^{3}} \right)} \right)} \right.} \right.}} \\ {w_{4} = {{fix}\left( {{mod}\left( {V_{4}\left( {{abs}\left( {{{{round}{}\left( {{m_{1}^{\prime}/4} + {n_{1}^{\prime}/4}} \right)} + {4 \times 10^{4}}},5^{4}} \right)} \right)} \right.} \right.}} \end{matrix} \right.$ where, w₁-w₄ are used as control parameters for subsequent shift operation, and fix is a rounding function to zero; and m₁′ is a maximum prime factor of a matrix row dimension m₁, and n₁′ is a maximum prime factor of a matrix column dimension n₁. 